home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 423 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Q about DLL's with Borland C++ 4.0
  5. Date: 4 Jan 1996 12:50:18 GMT
  6. Organization: Pipeline USA
  7. Message-ID: <4cgiea$mnf@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe8.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Jan 04, 1996 11:29:48 in article <Q about DLL's with Borland C++ 4.0>,
  15. 'Daniel Kobler <kobler@dma.epfl.ch>' wrote: 
  16.  
  17.  
  18. >Hello ! 
  19. >My problem is the following: I have functions in 4 files (*.c because they
  20.  
  21. >are written in C, but this not important), with a header file for each of 
  22. >these files (*.h, contains the headers of the functions in the
  23. corresponding 
  24. >*.c), and a fifth header file that contains the #define, typedef, .... 
  25. >One of these functions, called production, needs to be called by a macro
  26. of 
  27. >Excel. Therefore I made a DLL of these files, with the line 
  28. >void _export production(...); 
  29. >in file1.h (if the function is in file1.c). 
  30. >The macro of Excel recognizes the DLL, but says the function production
  31. does 
  32. >not exist in that DLL. What did I do wrong? Have I forgotten a key-word?
  33. Or 
  34. >is this "void _export production(...);" misplaced? 
  35. 1.  Wrap your exported function declarations with extern "C". 
  36.  
  37. 2.  Use the PASCAL keyword in those functions. 
  38.  
  39. 1 is to suppress C++ name mangling -- not applicable if 
  40. your source code is straight C.  2 converts all names to 
  41. upper case and suppresses the underscore prefixing normally 
  42. done to C symbols. 
  43.  
  44. Oops, just reread your message -- 1 is not applciable to you. 
  45.  
  46. Pete
  47.